Technical Q&As


PPCSYS 03 - C Function Pointers (1-May-95)


Q I understand how to use the Mixed Mode Manager for all my callbacks in Dialog code, etc. when calling from one type of code to another, but is it necessary to use MixedMode calls when calling PowerPC code from PowerPC code?

I have inherited C code from Think C in the following form:

int somefunc(void) { ... }

void freddy( void ) { int(*myfunc)();

myfunc = somefunc; . .. (*(myfunc))();   /* Invokes function "somefunc" */
. .}

This code runs fine under Think C. Will it always work OK under PowerPC or do I need to use UPP's when calling code like this?

A As long as you know you are calling code of the same type, i.e., 68K code calling 68K code, or PowerPC code calling PowerPC code, there is no need to go through Mixed Mode because there is no ambiguity about the calling conventions. C function pointers work just fine.

Technical Q&As
Previous Question | Contents | Next Question